import { RouteObject } from 'react-router-dom';
import { useRoutes } from 'react-router-dom';
import { BaseLayout } from '../pages/Layouts';
import { Home } from '../pages/Home';
import { To404, Page404 } from '../pages/404';

const routes: RouteObject[] = [
  {
    path: '/',
    element: <BaseLayout />,
    children: [
      {
        index: true,
        element: <Home />,
      },
    ],
  },
  {
    path: '/404',
    element: <Page404 />,
  },
  {
    path: '*',
    element: <To404 />,
  },
];

const RouteConfig = () => {
  const routeContent = useRoutes(routes);

  return routeContent;
};

export default RouteConfig;
